package com.xwqiang.controller;

import com.xwqiang.model.vo.AdminVo;
import com.xwqiang.service.AdminService;
import com.xwqiang.utils.Resp;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admins")
@RequiredArgsConstructor
@Api("后台管理员")
public class AdminController {

    private final AdminService adminService;

    @GetMapping("/{id}")
    public Resp<AdminVo> getAdmin(@PathVariable Integer id) {
        AdminVo adminVo = adminService.selectById(id);
        return Resp.success(adminVo);
    }

    @GetMapping("/string")
    public String aaa() {
        return "aaa";
    }
}
